Ext.define('ProjectAON.view.competentiesBeheren.Scherm26', {
    extend:'Ext.panel.Panel',
    alias:'widget.scherm26',

    title:'Competenties Beheren',

    initComponent:function () {
        var DeelCompetenties = Ext.getStore('Deelcompetenties');
        DeelCompetenties.loadData([],false);
        var SubCompetenties = Ext.getStore('Subcompetenties');
        SubCompetenties.loadData([],false);
        Ext.applyIf(this, {
            layout:'border',
            items:[
                {
                    collapsible:false,
                    region:'north',
                    resizable:false,
                    xtype:'panel',
                    items:[
                        {
                            xtype:'button',
                            text:'Terug',
                            icon:'http://whatisextjs.com/BAHO/icons/page_back.png',
                            action:'back'
                        },
                        {
                            xtype:'button',
                            text:'Hoofdcompetentie Toevoegen',
                            icon:'http://whatisextjs.com/BAHO/icons/add.png',
                            action:'add',
                            id: 'add'
                        },                        {
                            xtype:'button',
                            text:'Unselect',
                            icon:'http://whatisextjs.com/BAHO/icons/add.png',
                            action:'unselect'
                        },
                        {
                            xtype:'button',
                            text:'Bewerken',
                            icon:'http://whatisextjs.com/BAHO/icons/bullet_edit.png',
                            action:'edit'
                        },
                        {
                            xtype:'button',
                            text:'Verwijderen',
                            icon:'http://whatisextjs.com/BAHO/icons/delete.png',
                            action:'remove'
                        }
                    ]
                },
                {
                    collapsible:false,
                    region:'center',
                    width:Ext.getBody().getViewSize().width - 275,
                    layout:'column',
                    items:[
                        {
                            xtype:'panel',
                            columnWidth:.40,
                            flex:1,
                            layout:'absolute',
                            height:Ext.getBody().getViewSize().height - 60,
                            autoScroll:true,
                            items:[
                                {
                                    xtype:'grid',
                                    layout:'fit',
                                    id:'gridPanelHoofd',
                                    hideHeaders:true,
                                    titleCollapse:true,
                                    collapsible:true,
                                    title:'Hoofdcompetenties',
                                    cls:'gridPanel',
                                    /*tbar: [{
                                        text: 'Toevoegen',
                                        icon:'http://whatisextjs.com/BAHO/icons/add.png',
                                        action:'add'
                                    }],*/
                                    columns:[
                                        {dataIndex:'omschrijving', flex:1},
                                    ],
                                    store:'Hoofdcompetenties',
                                    action: 'deelcompetentie'

                                }
                            ]
                        },
                        {
                            xtype:'grid',
                            id:'gridPanelDeel',
                            columnWidth:.3,
                            flex:2,
                            hideHeaders:true,
                            titleCollapse:true,
                            collapsible:true,
                            title:'Deelcompetenties',
                            cls:'gridPanel',
                            columns:[
                                {dataIndex:'omschrijving', flex:1}
                            ],
                            store:'Deelcompetenties',
                            action: 'subcompetentie'
                        },
                        {
                            xtype:'grid',
                            id:'gridPanelSub',
                            columnWidth:.3,
                            flex:3,
                            hideHeaders:true,
                            titleCollapse:true,
                            collapsible:true,
                            title:'Subcompetenties',
                            cls:'gridPanel',
                            columns:[
                                {dataIndex:'omschrijving', flex:1 }
                            ],
                            store:'Subcompetenties'
                        }
                    ]
                }
            ]
        });
        this.callParent(arguments);
    }
});